Use windbg to check memory leak
2020.04.10
呼呼呼山
 热度
℃
From:
http://blogs.msdn.com/b/paullou/archive/2011/06/28/debugging-managed-code-memory-leak-with-memory-dump-using-windbg.aspx
1 2
| #Set symbols File >> Symbol File path SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
|
1
| .loadby sos clr or .loadby sos mscorwks!
|
1 2
| #Find largest GC Heapsize - leak is possible if > 1gb or so !EEHeap
|
1 2
| #Find type with the largest size !dumpheap -stat
|
1 2
| #put type here - find type with the largest size !dumpheap -type [TYPE]
|
1 2
| #put largest result here !do [ADDRESS]
|
Loop above as needed, this is where it gets a bit fuzzy. Look for repeating patterns and high threads
1 2
| #get a count of thread on the thing. Find a high thread count !threads
|
1 2
| #Pick a thread to look at it's stack - alternatively you can rum ~*kb for all thread stacks ~[THREAD ID]s
|
呼呼呼山
2020-04-10 11:50:34